// 玩家数据
let PlayerData = ()=>{
    let that = {};
    // 账号
    that.account = '123456';
    // 密码
    that.password = '789456';

    // UserID
    that.UserID = undefined;
    // 游戏ID
    that.GameID = undefined;
    // 微信返回的唯一ID
    that.uniqueID = '100000';
    // for(let i=0; i<7; i++){
    //     that.uniqueID += Math.floor(Math.random() * 10);
    // }
    // 名字
    that.nickName = '蜜蜂' + Math.floor(Math.random() * 10);
    // 头像地址
    that.avatarUrl = 'http://p0.so.qhmsg.com/t0133693c3523835cc5.jpg';

    // 属性
    that.attribute = {
        grade: 0,               // 等级
        blood: 100,             // 血 
        // 蓝 速度 魔法 攻击
        gold: 0,                // 金
        wood: 0,                // 木
        water: 0,               // 水
        fire: 0,                // 火
        soil: 0                 // 土
    };

    // 微信登录的回调
    that.onWXLoginSuccess = (data)=>{
        that.uniqueID = data.uniqueID;
        that.nickName = data.nickName;
        that.avatarUrl = data.avatarUrl;
    };

    // 登录服务器成功的消息
    that.loginSuccess = (data)=>{
        console.log('login Success = ', JSON.stringify(data));
        that.UserID = data.uid;
        that.GameID = data.uid;
        that.nickName = data.nickName;
        that.avatarUrl = data.avatarUrl;
        that.houseCardCount = data.houseCardCount;
    };

   




    return that;
};

export default PlayerData;